# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1InstalledApp do
  @moduledoc """
  Describes an installed app.

  ## Attributes

  *   `appId` (*type:* `String.t`, *default:* `nil`) - Output only. Unique identifier of the app. For Chrome apps and extensions, the 32-character id (e.g. ehoadneljpdggcbbknedodolkkjodefl). For Android apps, the package name (e.g. com.evernote).
  *   `appInstallType` (*type:* `String.t`, *default:* `nil`) - Output only. How the app was installed.
  *   `appSource` (*type:* `String.t`, *default:* `nil`) - Output only. Source of the installed app.
  *   `appType` (*type:* `String.t`, *default:* `nil`) - Output only. Type of the app.
  *   `browserDeviceCount` (*type:* `String.t`, *default:* `nil`) - Output only. Count of browser devices with this app installed.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Output only. Description of the installed app.
  *   `disabled` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the app is disabled.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the installed app.
  *   `homepageUri` (*type:* `String.t`, *default:* `nil`) - Output only. Homepage uri of the installed app.
  *   `osUserCount` (*type:* `String.t`, *default:* `nil`) - Output only. Count of ChromeOS users with this app installed.
  *   `permissions` (*type:* `list(String.t)`, *default:* `nil`) - Output only. Permissions of the installed app.
  *   `riskAssessment` (*type:* `GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RiskAssessmentData.t`, *default:* `nil`) - Output only. If available, the risk assessment data about this extension.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appId => String.t() | nil,
          :appInstallType => String.t() | nil,
          :appSource => String.t() | nil,
          :appType => String.t() | nil,
          :browserDeviceCount => String.t() | nil,
          :description => String.t() | nil,
          :disabled => boolean() | nil,
          :displayName => String.t() | nil,
          :homepageUri => String.t() | nil,
          :osUserCount => String.t() | nil,
          :permissions => list(String.t()) | nil,
          :riskAssessment =>
            GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RiskAssessmentData.t()
            | nil
        }

  field(:appId)
  field(:appInstallType)
  field(:appSource)
  field(:appType)
  field(:browserDeviceCount)
  field(:description)
  field(:disabled)
  field(:displayName)
  field(:homepageUri)
  field(:osUserCount)
  field(:permissions, type: :list)

  field(:riskAssessment,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RiskAssessmentData
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1InstalledApp do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1InstalledApp.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1InstalledApp do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
